<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2021-08-28 09:24:59
 * @Description: 租户等级表，规定可以有几个店铺、供应商
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-09-07 11:00:57
 * @FilePath: /qingshanERP/database/migrations/qingshanerp/2021_08_28_092459_create_tenant_level.php
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTenantLevel extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tenant_level', function (Blueprint $table) {
            $table->id();
            $table->foreignId('parent_id')->default(0)->comment('上一级id，升级前');
            $table->string('level_name', 100)->comment('级别名称');
            $table->integer('shop_num')->default(0)->comment('可用店铺数量');
            $table->integer('supplier_num')->default(0)->comment('可用供应商数量');
            $table->integer('days')->default(0)->comment('有效期');
            $table->decimal('prices',8,2)->default(0)->comment('购买价格');
            $table->boolean('status')->default(1)->comment('状态，1 正常，0 禁用');
            $table->boolean('del_flag')->default(0)->comment('删除状态，1 删除，0 未删除');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('tenant_level');
    }
}
